# for module compiling
import os
Import('RTT_ROOT')

cwd = str(Dir('#'))
objs = []
list = os.listdir(cwd)

objs += SConscript(cwd + "/../../STM32F4xx_Libraries/SConscript")
objs += SConscript(cwd + "/../../drivers/SConscript")
RTT_RTGUI = os.getenv('RTT_RTGUI')
if RTT_RTGUI:
    objs += SConscript(os.path.join(RTT_RTGUI, '..', '..', 'demo', 'examples', 'SConscript'))
else:
    objs += SConscript(os.path.join(RTT_ROOT, 'examples', 'gui', 'SConscript'))

for d in list:
    path = os.path.join(cwd, d)
    if os.path.isfile(os.path.join(path, 'SConscript')):
        objs = objs + SConscript(os.path.join(d, 'SConscript'))

Return('objs')
